package com.xpd.spring.demo;

import com.xpd.spring.demo.biz.IuserBiz;
import com.xpd.spring.demo.biz.UserBiz;
import com.xpd.spring.demo.mapper.UserMapper;
import com.xpd.spring.demo.web.UserController;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = AnnoConfig.class)
public class AopText {
    @Autowired
    UserController controller;
    @Autowired
    IuserBiz userBiz;
    @Autowired
    UserMapper userMapper;
    @Test
    public void test(){
        controller.findByid(100);
        controller.delByid(100);
    }


    //被aop切到的类，spring会对其代理  一般是用CGlib代理
@Test
    public void test1(){
        userBiz.login("张三","123");
}

}
